﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DomainModel
{
    public partial class SiteConfig
    {
        private SiteConfig()
        {
            //todo:initial data

        }

        private static SiteConfig singleton;
        private static object singletonMutex = new object();

        public static SiteConfig Singleton
        {
            get
            {
                if (singleton == null)
                {
                    lock (singletonMutex)
                    {
                        if (singleton == null)
                        {
                            using (Main db = new Main())
                            {
                                singleton = (from c in db.GetTable<SiteConfig>()
                                             select c).First<SiteConfig>();
                            }
                        }
                    }
                }

                return singleton;
            }
        }
    }

    public enum SiteStyle
    {
        Default = 0,
    }
}
